﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Delta
{
    public partial class FormModifyPSW : Form
    {
        public FormModifyPSW()
        {
            InitializeComponent();
        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void btnLogin_Click(object sender, EventArgs e)
        {
            if (txtOldPassWord.Text==txtNewPWD.Text)
            {
                User.NewPassWord = txtNewPWD.Text;
                 User.Password = FormLogin.Encrypt(User.NewPassWord, "1a2b3d4e");
               // User.Password = User.NewPassWord;
                this.Dispose();
                MessageBox.Show("密码修改成功！");
            }
            else
            {
                txtOldPassWord.Clear();
                txtNewPWD.Clear();
                txtOldPassWord.Focus();
                MessageBox.Show("两次密码输入不一致，请重新输入！");
            }
        }
    }
}
